<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLeaveTable extends Migration
{
    /**
     * Run the migrations.
     *
     *中止
     * @return void
     */
    public function up()
    {
        Schema::create('leave', function (Blueprint $table) {
            $table->increments('id');
	        $table->integer('uid')->comment('用户id')->nullable();
	        $table->integer('staff_id')->comment('员工id');
	        $table->integer('scheduling_id')->comment('排班id')->nullable();
//	        scheduling_id
	        $table->date('date_time')->comment('请假日期')->nullable();
	        $table->integer('store_station_id')->comment('店铺岗位id')->nullable();
	        $table->string('name')->comment('员工姓名');
	        $table->integer('staff_task_id')->comment('中止任务id')->nullable();
	        $table->integer('type')->comment('中止类型:1家有喜事，2身体不适，3调休，4其它');
	        $table->float('Adjustable')->comment('可调工时')->nullable();
	        $table->dateTime('start_time')->comment('开始时间');
	        $table->dateTime('end_time')->comment('结束时间');
	        $table->float('time')->comment('中止时长');
	        $table->text('comment')->comment('中止事由')->nullable();
	        $table->integer('status')->comment('申请状态：1申请中，2已同意，3不通过')->default(1);
	        $table->integer('store_id')->comment('所属店铺id')->nullable();
	        $table->integer('workflow_id')->comment('审核流程id')->nullable();
	        $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('leave');
    }
}
